<?php

use Faker\Generator as Faker;

$factory->define(\App\Models\Coupon::class, function (Faker $faker) {
    $price = price(rand(10, 99));
    $min_amount = price(rand(100, 999));

    return [
        'name' => "满" . $min_amount . "减" . $price,
        'code' => coupon(),
        'type' => 1,
        'price' => $price,
        'total' => rand(0, 99),
        'used' => 0,
        'min_amount' => $min_amount,
        'not_before' => now()->addMinute(rand(-99, 99)),
        'not_after' => now()->addMinute(rand(100, 999)),
        'enabled' => 1,
    ];
});
